package yingke.com.yingke.ui.left;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseArray;

/**
 * 该适配器用于处理数据与ViewPager的关系
 */

public class LeftTitleAdapter extends FragmentPagerAdapter {
    SparseArray<Fragment> fragments;
    public LeftTitleAdapter(FragmentManager fm, SparseArray<Fragment> fragments){
        super(fm);
        this.fragments=fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
